using System;
using System.Collections.Generic;
using System.Data.EntityClient;
using System.Data.Objects;
using System.Linq;
using System.Text;
using System.Data.Entity;
using System.Data;
using CloudPms.Domain.Interface;
using CloudPms.Entity.Entities;

namespace CloudPms.Domain.Repository
{
    /// <summary>
    /// 酒店营业日存储仓库
    /// <para>--------------------------</para>
    /// <para>@Author: cnalexi@gmail.com</para> 
    /// <para>@Create: 2012/9/29</para>  
    /// </summary>
    public class OrderRepository : RepositoryBase<Order>, IOrderRepository
    {
        public void BatchFindOrder(string hotelId, string searchKey)
        {
            string sql = "SELECT * FROM [Order]";
            using (var context = DbContextService.GetDbContext(hotelId, typeof(Order)))
            {
                var results= context.Database.SqlQuery<OrderModel>(sql, new object[] {hotelId,searchKey});

                /*
                    var firstName = "John";
                    var id = 12;
                    var sql = @"Update [User] SET FirstName = {0} WHERE Id = {1}";
                    ctx.Database.ExecuteSqlCommand(sql, firstName, id);
                 */
            }
        }
    }
    
}
